<script>
    // console.log('a');
    // console.log('b');
    // console.log('c');
    // setTimeout(function() {
    //     console.log('d');
    // }, 2000);
    // console.log('e');


    console.log('---------ajax------------')
        // ajax 请求是异步
    console.log('a');

    var result;
    var ajax = new XMLHttpRequest();
    var url = 'http://132.232.87.95:3003/product/list?pageNum=1';
    ajax.open('get', url);
    ajax.send();
    ajax.onreadystatechange = function() {
        if (ajax.readyState == 4 && ajax.status == 200) {
            console.log('b');
            result = ajax.responseText;
        }
    }
    console.log('c');
    console.log('result', result); // undefine, 因为ajax是异步的
</script>